package com.example.boke.mapper;

import com.example.boke.entity.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Xdoor
 * @version 1.0
 * @date 2021/10/20 17:44
 */

@Mapper
public interface CommentMapper
{
    @Insert("insert into comment values(null,#{content},#{author},#{bokeId},#{created},#{bokeId})")
    void insert(Comment comment);

    @Select("select * from comment where boke_id=#{bokeId}")
    List<Comment> selectBybokeId(int bokeId);

    @Delete("delete from comment where id=#{id},user_id=#{userId}")
    void delete(int id,Integer userId);
}
